//
//  ClassCollectionViewCell.m
//  记账deam
//
//  Created by apple on 16/5/5.
//  Copyright © 2016年 --- 杨江 ---. All rights reserved.
//

#import "ClassCollectionViewCell.h"

@implementation ClassCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //添加控件
        [self initTheUI];
//        self.backgroundColor = [UIColor yellowColor];
    }
    return self;
}


- (void)initTheUI{
    _classImage = [[UIImageView alloc]init ];
    _classImage.bounds = CRM(0, 0, 32*PROPORTION_H, 32*PROPORTION_H);
    _classImage.center = CPM(CGRectGetMidX(self.contentView.frame), 21*PROPORTION_H);
//    [_classImage setImage:[UIImage imageNamed:@"Unknown"]];
//    _classImage.backgroundColor = [UIColor colorWithRed:1.0 green:0.4737 blue:0.1144 alpha:1.0];
       _classImage.layer.cornerRadius = 16 *PROPORTION_H;
    _label = [[UILabel alloc]init];
    _label.font = [UIFont systemFontOfSize:14];
    _label.textAlignment = NSTextAlignmentCenter;
//    _label.backgroundColor = [UIColor redColor];
//    [_label sizeToFit];
    
}

- (void)setMessageSize:(CGSize)messageSize {
    
    _label.bounds = CRM(0, 0, messageSize.width + 10, 15*PROPORTION_H);
    _label.center = CPM(CGRectGetMidX(self.contentView.frame), 40*PROPORTION_H + 7.5*PROPORTION_H);
   
    [self.contentView addSubview:_classImage];
   [self.contentView addSubview:_label];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


@end
